﻿import React from 'react'

export default class refDemo extends React.Component{

    constructor(props){
        super(props)
        this.testRef=React.createRef()
    }
    componentDidMount(){
        console.log(this.testRef.current.style);
       
    }
    render(){
        return(
            <div>
                <p>这是一个refDemo组件</p>
                <div ref={this.testRef}></div>
                <div ref={(ref)=>{console.log(ref,1111111);}}></div>
            </div>
        )
    }
}